package com.wc.blue_bridge_test.base.T9;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congege
 * @Description
 * @Date Created in 2023/12/24-11:44
 */
public class Main {
    static FastReader in = new FastReader();
    static int maxN = (int) 1e4 + 7;
    static int[] map = new int[maxN];

    public static void main(String[] args) {
        int n = in.nextInt();
        Arrays.fill(map, -1);
        int idx;

        for (int i = 1; i <= n; i++) {
            idx = in.nextInt();
            if (map[idx] == -1) {
                map[idx] = i;
            }
        }
        idx = in.nextInt();
        System.out.println(map[idx]);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }
}
